FileChooser: Initialize search engines on demand
authorTomas Bzatek <tbzatek@redhat.com>
Wed, 7 Apr 2010 13:07:05 +0000 (15:07 +0200)
committerTomas Bzatek <tbzatek@redhat.com>
Wed, 7 Apr 2010 13:07:05 +0000 (15:07 +0200)
We postpone initialization of the search engines until
it's really needed. See bug 614971 for reference.

gtk/gtkfilechooserdefault.c

index 1d6042998652aea623c351d412c9e0d1711dc402..429e8c4df0c74728afaffd3f8f64fc5f324470f3 100644 (file)
@@ -228,15 +228,6 @@ enum {
   GTK_TREE_MODEL_ROW,
 };
 
-static gboolean
-search_is_possible (GtkFileChooserDefault *impl)
-{
-  if (impl->search_engine == NULL)
-    impl->search_engine = _gtk_search_engine_new ();
-  
-  return impl->search_engine != NULL;
-}
-
 /* Interesting places in the shortcuts bar */
 typedef enum {
   SHORTCUTS_SEARCH,
@@ -2266,10 +2257,7 @@ shortcuts_model_create (GtkFileChooserDefault *impl)
                                              G_TYPE_BOOLEAN,   /* pixbuf cell visibility */
                                              G_TYPE_POINTER);  /* GCancellable */
 
-  if (search_is_possible (impl))
-    {
-      shortcuts_append_search (impl);
-    }
+  shortcuts_append_search (impl);
 
   if (impl->recent_manager)
     {